package com.example.mvplibrary.ui.fragment;

import com.example.mvplibrary.model.BaseModel;
import com.example.mvplibrary.presenter.BasePresenter;
import com.example.mvplibrary.view.BaseView;

public abstract class BaseMvpFragment<V extends BaseView, M extends BaseModel, P extends BasePresenter<V, M>> extends BaseFragment {

    public P mPresenter;

    @Override
    protected void initData() {
        mPresenter = createPresenter();
        if (mPresenter != null) {
            mPresenter.bindView((V) this);
        }
        initEvent();
    }

    protected abstract P createPresenter();

    protected abstract void initEvent();
}
